{extend name="$_tpl_public_layout_danceadmin"/}


{block name="breadcrumb"}
<ol class="breadcrumb">
	<li class="breadcrumb-item"><a href="{:url('admin/index/index')}">{:config('system.site_title')}</a></li>
	<li class="breadcrumb-item"><a href="{:url('mobmall_manage/slide/index')}">{$sideName}</a></li>
</ol>
{/block}


{block name="pageheader"}
{$sideName}
{/block}


{block name="content"}
<div class="card">
	<div class="card-body">
		<form method="post" action="{:url('mobmall_manage/slide/doAdd')}" enctype="multipart/form-data" class="form-horizontal J_ajaxForm">
			<input type="hidden" name="id" value="{$id}" />
			<div class="form-group row">
				<label class="col-sm-2 control-label">标题</label>
				<div class="col-sm-5">
					<input type="text" name="data[title]" value="{$info['title']}" class="form-control" />
				</div>
				<div class="col-sm-5"></div>
			</div>
			<div class="form-group row">
				<label class="col-sm-2 control-label">目标页面类型</label>
				<div class="col-sm-5">
					<?php
						$page_type_config = config('engineeconfig.page_type_config');
					?>
					<div class="J_pageTypeSelect" data-mode="foot_page">
						<input type="hidden" name="data[page_flag]" value="{$info['page_flag']}" class="J_pageFlag" />
						<input type="hidden" name="data[page_data]" value="{$info['page_data']}" class="J_pageData" />
						<input type="hidden" name="data[page_extra]" value="{$info['page_extra']}" class="J_pageExtra" />
						<input type="hidden" name="data[page_name]" value="{$info['page_name']}" class="J_pageName" />
						<input type="hidden" name="data[page_subname]" value="{$info['page_subname']}" class="J_pageSubname" />
						<?php
							$pageTypeShow = '';
						?>
						{volist name="page_type_config" id="vo"}
						<?php
							if ($info['page_flag'] == $vo['flag']) {
								$checked = 'checked';
								$pageTypeShow = $vo['name'];
								if ($info['page_subname']) {
									$pageTypeShow .= '|'.$info['page_subname'];
								}
							} else {
								$checked = '';
							}
						?>
						<label class="radio-inline"><input type="radio" name="foot_page" value="{$key}" data-name="{$vo['name']}" {$checked}>{$vo['name']}</label>
						{/volist}
						<div class="alert alert-primary mt-3 J_pageTypeShow">{$pageTypeShow}</div>
						<div>{$info['page_data']}</div>
						<div>{$info['page_extra']}</div>
					</div>
				</div>
				<div class="col-sm-5"></div>
			</div>
			<div class="form-group row">
				<label class="col-sm-2 control-label">图片</label>
				<div class="col-sm-5">
					<div class="upload-control">
						<input type="file" name="picurl" class="J_uploadfile" />
					</div>
					<div class="upload-show J_preview">
						<img src="{$info['picurl']}" class="upload-img-sm" onerror="Javascript:this.src='/static/danceAdmin/images/nopic.png';" />
					</div>
					<div class="upload-help">不做压缩处理，大小2M以下,建议尺寸480×280px</div>
				</div>
				<div class="col-sm-5"></div>
			</div>
			<div class="form-group row">
				<label class="col-sm-2 control-label">排序</label>
				<div class="col-sm-5">
					<input type="text" name="data[vieworder]" value="{$info['vieworder']}" class="form-control" />
				</div>
				<div class="col-sm-5"></div>
			</div>
			<div class="form-group row">
				<label class="col-sm-2 control-label">状态</label>
				<div class="col-sm-5">
					<?php echo isOpenRadioHtmlB('data[status]', $info['status']); ?>
				</div>
				<div class="col-sm-5"></div>
			</div>
			<div class="clearfix form-actions">
				<div class="offset-md-2 col-sm-10">
					<button type="submit" class="btn btn-primary btn-sm J_ajaxSubmit">保存修改</button>
				</div>
			</div>
		</form>
	</div>
</div>
{/block}


{block name="script"}
<!--选择目标页面类型-->
{include file="./themes/mobmall_manage/pagedestination/page_type.html" /}

<!-- 上传图片展示 -->
<script type="text/javascript" src="__STATIC__/dancewidgets/uploadPreview/uploadPreview.js"></script>
{/block}